Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow config options to be an enum. #3494

Merged
merged 3 commits into from
Sep 23, 2024
Merged

Conversation

mitchell-as
Copy link
Contributor

@mitchell-as mitchell-as commented Sep 17, 2024

TaskDX-2927 ConfigMediator supports an enum type

Use it for 'security.prompt.level'.

Use it for 'security.prompt.level'.
@mitchell-as mitchell-as marked this pull request as ready for review September 17, 2024 18:47
@@ -52,6 +55,14 @@ func (s *Set) Run(params SetParams) error {
if err != nil {
return locale.WrapInputError(err, "Invalid integer value")
}
case configMediator.Enum:
enums := option.Default.(*configMediator.Enums)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is a potential panic if the type check fails. We should add an ok check here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had more faith in us, but very well, I've added a check :)

@mitchell-as mitchell-as merged commit 58e1176 into version/0-47-0-RC1 Sep 23, 2024
8 checks passed
@mitchell-as mitchell-as deleted the mitchell/dx-2927 branch September 23, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants